import { service } from '@/service'

export const addOrUpd = (data?: any) => {
  return service.request({
    url: '/hbsys-system/sorg/addOrUpd',
    method: 'POST',
    data
  })
}

export const editOrUpd = (sorgInfoId, data?: any) => {
  return service.request({
    url: '/hbsys-system/sorg/addOrUpd',
    method: 'POST',
    data: {
      ...data,
      sorgInfoId
    }
  })
}

export const detailSorg = (sorgInfoId?: any) => {
  return service.request({
    url: '/hbsys-system/sorg/detail',
    method: 'POST',
    data: {
      sorgInfoId
    }
  })
}

export const listSorg = (data?: any) => {
  return service.request({
    url: '/hbsys-system/sorg/list',
    method: 'POST',
    data
  })
}

export const pageSorg = (data?: any) => {
  return service.request({
    url: '/hbsys-system/sorg/page',
    method: 'POST',
    data
  })
}

export const stateSorg = (data?: any) => {
  return service.request({
    url: '/hbsys-system/sorg/state',
    method: 'POST',
    data
  })
}

export const sorgImport = (data?: any) => {
  return service.request({
    url: `hbsys-system/sorg/import`,
    method: 'post',
    data
  })
}

export const sorgShixinweifa = (data?: any) => {
  return service.request({
    url: `hbsys-system/sorg/shixinweifa`,
    method: 'post',
    data
  })
}

export const sorgHuodongyichang = (data?: any) => {
  return service.request({
    url: `hbsys-system/sorg/huodongyichang`,
    method: 'post',
    data
  })
}

export const downloadExcelTemplateSorg = (params?: any) => {
  return service.request({
    url: `hbsys-system/sorg/downloadExcelTemplate`,
    method: 'get',
    params,
    responseType: 'blob'
  })
}

export const sorgDel = (data?: any) => {
  return service.request({
    url: `hbsys-system/sorg/del`,
    method: 'post',
    data
  })
}

export const sorgActOrBlack = (data?: any) => {
  return service.request({
    url: `hbsys-system/sorg/actOrBlack`,
    method: 'post',
    data
  })
}

export const sorgLedger = (params?: any) => {
  return service.request({
    url: `hbsys-system/sorg/ledger`,
    method: 'get',
    params,
    responseType: 'blob'
  })
}

export const v2Page = (params?: any) => {
  return service.request({
    url: `hbsys-system/dpcont/v2Page`,
    method: 'get',
    params
  })
}

export const riskHandleStrPage = (params?: any) => {
  return service.request({
    url: `hbsys-system/dpcont/riskHandleStrPage`,
    method: 'get',
    params
  })
}

export const pageCCJC = (data?: any) => {
  return service.request({
    url: `hbsys-system/dpcont/pageCCJC`,
    method: 'post',
    data
  })
}

export const pageWTXZ = (data?: any) => {
  return service.request({
    url: `hbsys-system/dpcont/pageWTXZ`,
    method: 'post',
    data
  })
}

export const queryByPage = (data?: any) => {
  return service.request({
    url: `hbsys-system/sorgInfos/queryByPage`,
    method: 'post',
    data
  })
}
